<script setup>
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app';

// 应用启动时
onLaunch(() => {
	console.log('App Launch');

	// 检查是否有登录状态
	const isLoggedIn = uni.getStorageSync('isLoggedIn');
	console.log('登录状态:', isLoggedIn ? '已登录' : '未登录');
});

// 应用显示时
onShow(() => {
	console.log('App Show');
});

// 应用隐藏时
onHide(() => {
	console.log('App Hide');
});
</script>

<style>
/*每个页面公共css */
/* 重置样式 */
page {
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
		Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
	font-size: 14px;
	color: #333;
	background-color: #f5f5f5;
}

/* 去除所有元素的内外边距 */
view,
text,
image,
button,
input,
textarea,
scroll-view {
	box-sizing: border-box;
}

/* 常用flex布局 */
.flex-row {
	display: flex;
	flex-direction: row;
}

.flex-column {
	display: flex;
	flex-direction: column;
}

.flex-center {
	display: flex;
	justify-content: center;
	align-items: center;
}

.flex-between {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.flex-around {
	display: flex;
	justify-content: space-around;
	align-items: center;
}

.flex-1 {
	flex: 1;
}

/* 溢出省略号 */
.ellipsis {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
</style>
